<?php
$this->title = $ptitle.'-零件列表';
$this->params['breadcrumbs'][]='>';
$this->params['breadcrumbs'][] = ['label' => '产品管理', 'url' => ['/admin/product/list']];
$this->params['breadcrumbs'][]='>';
$this->params['breadcrumbs'][] = $this->title;
$productid = Yii::$app->request->get("productid");
?>
    <!-- main container -->
        
        <div class="container-fluid">
            <div id="pad-wrapper" class="users-list">
                <div class="row-fluid header">
                    <h3><?php echo $this->title?></h3>
                    <div class="span10 pull-right">
                        <a href="<?php echo yii\helpers\Url::to(['product/partsadd','productid'=>$productid]) ?>" class="btn-flat success pull-right">
                            <span>&#43;</span>
                            添加新零件
                        </a>
                    </div>
                </div>

                    <?php
                    if (Yii::$app->session->hasFlash('info')) {
                        echo Yii::$app->session->getFlash('info');
                    }
                    ?>
                <!-- Users table -->
                <div class="row-fluid table">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th class="span3 sortable">
                                <span class="line"></span>ID
                            </th>
                            <th class="span3 sortable">
                                <span class="line"></span>零件名称
                            </th>
                            <th class="span3 sortable">
                                <span class="line"></span>零件简介
                            </th>
                            <th class="span3 sortable align-right">
                                <span class="line"></span>操作
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <!-- row -->
                        <?php foreach($data as $v): ?>
                            <tr class="first">
                                <td>
                                    <?php echo $v['id'] ?>
                                </td>
                                <td>
                                    <?php echo $v['title'] ?>
                                </td>
                                <td>
                                    <?php echo $v['info'] ?>
                                </td>
                                <td class="align-right">
                                    <a href="<?php echo yii\helpers\Url::to(['product/partsmod', 'partsid' => $v['id'],'ptitle'=>$ptitle,'productid'=>$productid]); ?>">编辑</a>
                                    <a href="<?php echo yii\helpers\Url::to(['product/partsdel', 'partsid' => $v['id']]); ?>">删除</a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
                <div class="pagination pull-right">
                    <?php echo yii\widgets\LinkPager::widget([
                        'pagination' => $pager,
                        'prevPageLabel' => '&#8249;',
                        'nextPageLabel' => '&#8250;',
                        ]); ?>
                </div>
                <!-- end users table -->
            </div>
        </div>

